package mirabilis.samples.cec2014;

import java.io.*;
import java.util.Scanner;

public class testmain {
	public static void main(String[] args) throws Exception{
		
		int i,j,k,n,m,func_num;
		double[] f,x;
		File fpt;
		
		m=3;
		n=10;
		
		x = new double[m*n];
		f = new double[m];
		
		testfunc tf = new testfunc();
		
		for (i=0;i<30;i++)
		{
			func_num = i+1;
			fpt = new File("input_data/shift_data_"+func_num+".txt");
			//System.out.println(fpt.toString());
			Scanner input = new Scanner(fpt);
			
			for(k=0;k<n;k++)
			{
				String s=input.next();
				x[k] = Double.parseDouble(s);
			}
			
			for(int ii=0;ii<n;ii++){
				//System.out.print(x[ii]+" ");
			}
			//System.out.println();
			
			input.close();
			
			
			for(j=0;j<n;j++)
			{
				x[1*n+j] = 0.0;
				//System.out.println(x[1*n+j]);
			}
			for (j = 0; j < n; j++)
			{
				x[2*n+j]=10.0;
				/*printf("%Lf\n",x[1*n+j]);*/
			}

			
			for (k=0;k<1;k++)
			{
				tf.test_func(x,f,n,m,func_num);
				for(j=0;j<m;j++)
				{
					System.out.println("f"+func_num+"(x["+(j+1)+"])="+f[j]);
				}
			}
			
			
			
		}
		
		
	}
}
